﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;

namespace BSCMFF.Web.UserControls.Ratings
{
    /// <summary>
    /// Rating bar.
    /// </summary>
    /// <remarks></remarks>
    public partial class RatingBar : System.Web.UI.UserControl
    {
        /// <summary>
        /// Handles the Load event of the Page control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        /// <remarks></remarks>
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        /// <summary>
        /// Gets or sets a value indicating whether [RB enabled].
        /// </summary>
        /// <value><c>true</c> if [RB enabled]; otherwise, <c>false</c>.</value>
        /// <remarks></remarks>
        public bool RBEnabled 
        {
            get
            {
                return ratingBar.Enabled;
            }
            set
            {
                ratingBar.Enabled = value;
            }
        }

        /// <summary>
        /// Gets or sets the db value.
        /// </summary>
        /// <value>The db value.</value>
        /// <remarks></remarks>
        public int? DbValue
        {
            get
            {
                return Convert.ToInt32(ratingBar.DbValue);
            }
            set
            {                
                ratingBar.DbValue = Convert.ToDecimal(value);                
            }
        }
    }
}